#include "TcpServer.h"

TcpServer::TcpServer(unsigned short port, string ip)
    : _acceptor(port, ip), _loop(_acceptor)
{
}
void TcpServer::setAllCallbacks(Callback &&cb1, Callback &&cb2, Callback &&cb3)
{
    _loop.setAllCallbacks(std::move(cb1),
                          std::move(cb2),
                          std::move(cb3));
}
void TcpServer::start()
{
    _acceptor.ready();
    _loop.loop();
}
void TcpServer::stop()
{
    _loop.unloop();
}